﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using mscook.core.domain;
using System.ComponentModel.DataAnnotations;

namespace mscook.mvc.Models
{
    public class CenterPresentModel : CenterBaseModel
    {
        public CenterPresentModel()
        {
            Amount = 1;
            PresentLit=new List<Present>();
        }
        public IList<Present> PresentLit
        {
            set;
            get;
        }

        [Required(ErrorMessage = "地址必填")]
        public string Address
        {
            set;
            get;
        }
        [Required(ErrorMessage = "联系电话必填")]
        [RegularExpression(@"((\d{11})|^((\d{7,8})|(\d{4}|\d{3})-(\d{7,8})|(\d{4}|\d{3})-(\d{7,8})-(\d{4}|\d{3}|\d{2}|\d{1})|(\d{7,8})-(\d{4}|\d{3}|\d{2}|\d{1}))$)", ErrorMessage = "请填写正确格式的电话号码")]
        public string Tel
        {
            set;
            get;
        }

        [Required(ErrorMessage = "请输入兑换数量")]
        [RegularExpression("^[0-9]*$", ErrorMessage = "请填写数字")]
        public int Amount
        {
            set;
            get;
        }

    }
}